begintownscript;
variables;
short choice,i,j;

body;
beginstate init_state;
i = 0;
while(char_ok(i) == 0){
	i = i + 1;
}
set_character_pose(i,0);
set_character_facing(i,0);
message_dialog("I wandered through the maze of alleyways that served as highways for the city's less... upright... citizens. Unfortunately they're only really useful as a way to get around if you know your way about-- I didn't.","So I was stuck wandering aimlessly, hauling 180 pounds of dead weight that was Sly. I didn't know where I was planning to go, really. I had to get out of the city, but I didn't have any idea of how to do that.");
break;

beginstate exit_state;
break;

beginstate start_state;
break;

beginstate 10;
if(get_flag(17,0) == 0)
	message_dialog("The city was as putrid as I remembered, and Sly was getting really heavy. I wasn't in great shape-- five years in a prison cell you can hardly turn around in will do that to you. I didn't exactly have a lot of reason to stay fit.","If I kept dragging him along for much longer I'd wind up unconscious like he was. I couldn't just dump him, though. Not in some alley like this.");
set_flag(17,0,1);
break;

beginstate 11;
block_entry(1);
message_dialog("That's the way I came from.","");
break;

beginstate 12;
if(get_flag(17,1) == 0)
	message_dialog("To the east I could see an opening out onto paved road. Finally, I'd found a way out of this maze!","");
set_flag(17,1,1);
break;

beginstate 13;
if(get_flag(17,2) == 0){
	set_flag(17,2,1);
	reset_dialog();
	add_dialog_str(0,"Carrying an unconscious man through the streets was bound to attract attention. Attention was the very last thing I needed.",0);
	add_dialog_str(1,"I decided to leave Sly lying in the mouth of the alley. I placed him behind a dumpster, where hopefully he would be hidden from view. I didn't want to leave him helpless in a city like Cigosal-- but I didn't have much choice.",0);
	add_dialog_str(2,"Hopefully the stun spell would wear off soon. It had behaved rather erratically, and I wasn't real sure how much of an effect it'd had on him. Hopefully no permanent damage..._",0);
	add_dialog_choice(0,"OK");
	choice = run_dialog(1);

	activate_hidden_group(1);
	set_character_pose(23,14);
	set_name(23,"Sly");
	force_instant_terrain_redraw();

	message_dialog("I cautiously prepared to step out into the street, but out of the corner of my eye I caught a glimpse of a guard. I glanced about and saw another guard moving through the crowd.","I stepped back into the shadows. It wasn't safe to move about the city in broad daylight. I turned away, and started back down the alley.");
}
break;

beginstate 14;
block_entry(1);
message_dialog("I had decided that sticking to the alleys was my best bet. Moving through the streets in broad daylight was a sure way to wind up back at the gallows.","");
break;

beginstate 15;
if(get_flag(17,2) == 0){
	block_entry(1);
	message_dialog("I didn't know my way around this labyrinth of alleys, I would probably do better on paved roads. Like the one to the east.","");
}
break;

beginstate 16;
set_character_facing(i,2);
relocate_character(i,27,10);
force_view_center(27,10);
force_instant_terrain_redraw();
pause(3);

relocate_character(i,26,10);
force_view_center(26,10);
force_instant_terrain_redraw();
pause(3);

relocate_character(i,25,10);
force_view_center(25,10);
force_instant_terrain_redraw();
pause(3);

relocate_character(i,24,10);
force_view_center(24,10);
force_instant_terrain_redraw();
pause(3);

activate_hidden_group(4);
relocate_character(i,23,10);
force_view_center(23,10);
force_instant_terrain_redraw();
pause(3);


relocate_character(26,19,10);
set_character_facing(26,6);
relocate_character(i,22,10);
force_view_center(22,10);
force_instant_terrain_redraw();
pause(1);
play_sound(18);

set_character_pose(26,2);
text_bubble_on_char(i,"!");
force_instant_terrain_redraw();
pause(3);

message_dialog("A man stepped out of an intersecting alley to bar my way. He wore the same armor as Jerald had.","I spun so fast I almost tripped. The armored man just stood his ground and watched on as I scrambled away.");

set_character_facing(i,6);
relocate_character(i,23,10);
force_view_center(23,10);
force_instant_terrain_redraw();
pause(3);

text_bubble_on_char(i,"");
relocate_character(i,24,10);
force_view_center(24,10);
force_instant_terrain_redraw();
pause(3);

relocate_character(i,25,10);
force_view_center(25,10);
force_instant_terrain_redraw();
pause(3);

activate_hidden_group(2);
relocate_character(i,26,10);
force_view_center(26,10);
force_instant_terrain_redraw();
pause(3);

set_character_facing(i,0);
relocate_character(i,27,10);
force_view_center(27,10);
force_instant_terrain_redraw();
pause(3);

play_sound(18);
set_character_pose(24,2);
text_bubble_on_char(i,"!");
force_instant_terrain_redraw();
pause(3);

set_character_facing(i,2);
force_view_center(26,10);
relocate_character(i,26,10);
force_instant_terrain_redraw();
pause(3);

relocate_character(24,27,9);
activate_hidden_group(3);
text_bubble_on_char(i,"");
relocate_character(i,25,10);
force_view_center(25,10);
force_instant_terrain_redraw();
pause(3);

set_character_facing(i,4);
relocate_character(i,24,11);
force_view_center(24,11);
force_instant_terrain_redraw();
pause(3);

play_sound(18);
set_character_pose(25,2);
text_bubble_on_char(i,"!");
force_instant_terrain_redraw();
pause(3);

relocate_character(i,24,10);
relocate_character(26,20,10);
relocate_character(25,24,12);
relocate_character(24,27,10);
set_character_facing(24,2);
force_view_center(24,10);
relocate_character(i,24,10);
pause(5);

relocate_character(26,21,10);
relocate_character(25,24,12);
relocate_character(24,26,10);
relocate_character(i,24,10);
force_instant_terrain_redraw();
pause(5);

relocate_character(26,22,10);
force_instant_terrain_redraw();
pause(2);

message_dialog("I was surrounded. I wanted to shout, but there was no point. Nobody would come to help.","");
text_bubble_on_char(i,"");
move_to_new_town(18,46,1);

break;

beginstate 100;
block_entry(1);
break;

beginstate 101;
block_entry(1);
if(get_flag(16,2) == 1)
	set_state_continue(14);
break;